﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Threading.Tasks;
using System.Data.SqlClient;
using DAL;

namespace BLL
{
    public class ForChart
    {
        public SqlDataReader ToChart()
        {
            DBHelper.ConnectionOpen();
            string sql = string.Format(@"select classname,count(*) from Book,BookClass where book.ClassID = BookClass.ClassID group by book.ClassID,ClassName");
            SqlCommand cmd = new SqlCommand(sql, DBHelper.Connection);
            SqlDataReader dr = cmd.ExecuteReader();
            return dr;
        }
    }
}
